<?php get_header() ?>

	<div id="container">
		<div id="content">

<?php if (have_posts()) : ?>

			<h2 class="page-title"><?php _e('Search Results for:', 'dkret') ?> <span id="search-terms"><?php the_search_query() ?></span></h2>

<?php while ( have_posts() ) : the_post(); ?>

			<div id="post-<?php the_ID() ?>" <?php post_class('search') ?>>
				<div class="entry-header">
					<h3 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'dkret'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></a></h3>
					<div class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s &#8211; %2$s', 'dkret'), the_date('', '', '', false), get_the_time()) ?></abbr></div>
				</div><!-- .entry-header -->
				<div class="entry-content">
<?php 
					$options=get_option('dkret3');
					if($options['summary'] == 1 ) the_excerpt(''.__('Read More <span class="meta-nav">&raquo;</span>', 'dkret').'');
					else the_content(''.__('Read More <span class="meta-nav">&raquo;</span>', 'dkret').'');
?>

				</div>
<?php if ( $post->post_type == 'post' ) { ?>
				<div class="entry-meta">
					<span class="author vcard"><span class="icontext"><?php _e('By','dkret') ?></span><?php the_author_posts_link() ?></span>
					<span class="meta-sep">|</span>
					<span class="cat-links"><span class="icontext"><?php _e('Posted in','dkret') ?></span><?php the_category(', ') ?></span>
					<span class="meta-sep">|</span>
					<?php the_tags('<span class="tag-links"><span class="icontext">' . __('Tagged','dkret') . '</span> ', ', ', '</span><span class="meta-sep">|</span>'); ?>
					<span class="comments-link"><?php comments_popup_link(__('Comments (0)','dkret'), __('Comments (1)','dkret'), __('Comments (%)','dkret'),'', __('Comments off','dkret') ); ?></span>
				</div>
<?php } ?>

				<?php edit_post_link(__('Edit', 'dkret'), "<span class=\"edit-link\">", "</span>"); ?>

			</div><!-- .post -->

<?php endwhile; ?>

<?php if(function_exists('wp_pagenavi')) :
		wp_pagenavi();
	else : ?>
			<div id="nav" class="navigation">
				<?php next_posts_link(__('<span class="nav-previous"><span class="meta-nav">&laquo;</span> Older posts</span>', 'dkret')) ?>
				<?php previous_posts_link(__('<span class="nav-next">Newer posts <span class="meta-nav">&raquo;</span></span>', 'dkret')) ?>
			</div><!-- #nav .navigation -->

<?php endif; ?>

<?php else : ?>

			<div id="post-0" class="post noresults">
				<h2 class="entry-title"><?php _e('Nothing Found', 'dkret') ?></h2>
				<div class="entry-content">
					<p><?php _e('Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'dkret') ?></p>
				</div>
				<form id="noresults-searchform" method="get" action="<?php bloginfo('home') ?>">
					<div>
						<input id="noresults-s" class="text" name="s" type="text" value="<?php the_search_query() ?>" size="40" />
						<input id="noresults-searchsubmit" class="button" name="searchsubmit" type="submit" value="<?php _e('Find', 'dkret') ?>" />
					</div>
				</form>
			</div><!-- .post -->

<?php endif; ?>

		</div><!-- #content -->
	</div><!-- #container -->

<?php get_sidebar() ?>
<?php get_footer() ?>